<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./echarts.min.js"></script>
</head>

<body>
    <div id="box" style="width:1000px;height:400px;border:1px solid black"></div>
</body>
<script>
    let myCharts = echarts.init(document.getElementById('box'));
    let option = {
        title: {
            text: '1111',
            textStyle: {
                color: 'red'
            },
            left:'center'
        },
        xAxis: {
            // show:false,
            name: 'X轴',
            data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
        },
        yAxis: {
            show: true,
            axisLine:{
                show:true
            },
            axisTick:{
                show:true
            }
        },
        series: {
            //决定展示什么类型的图形图标
            type: 'bar',
            data: [10, 20, 30, 40, 50, 60],
            itemStyle: {
                normal: {
                    color:(p)=>{
                        let data = ['red','green','blue','yellow','black','skyblue'];
                        return data[p.dataIndex]
                    }
                }
            },
        }
    };

    myCharts.setOption(option)
</script>

</html>